//package com.job.updateinfojob.api;
//
//
////import cn.hutool.core.date.DateTime;
//
////import com.job.updateinfojob.dto.InfoPolymerization;
//import com.job.updateinfojob.dto.InfoPolymerization;
//        import com.job.updateinfojob.entity.OsInfoEntity;
//import com.job.updateinfojob.mp_service.OsinfoService;
//import com.job.updateinfojob.res.R;
////import com.job.updateinfojob.service.IGetInfoService;
//import com.job.updateinfojob.service.IGetInfoService;
//import com.job.updateinfojob.util.ResultUtil;
////import io.swagger.annotations.Api;
////import io.swagger.annotations.ApiOperation;
////import io.swagger.annotations.ApiOperation;
//import com.job.updateinfojob.vo.OsInfoDtoVo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.time.LocalDateTime;
//import java.time.format.DateTimeFormatter;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * TODO
// *
// * @Description
// * @Author Lx
// * @Date 2024/8/23 上午12:09
// **/
//@RestController
//@RequestMapping("/updateinfo")
//@Slf4j
//@Api(tags = "getInfoController",value = "获取系统环境信息")
//public class getInfoController {
//
//    @Resource
//    IGetInfoService iGetInfoService;
//
//    @Resource
//    OsinfoService osinfoService;
////
//////    @ApiOperation(value = "获取最新信息")
////    @GetMapping("/getInfoOfNew")
////    public R getInfoOfNew() throws JsonProcessingException {
////        log.info("获取最新信息接口被调用");
////        InfoPolymerization newInfo = iGetInfoService.getNewInfo();
////        return ResultUtil.data(newInfo);
////    }
//
//
//    @ApiOperation(value = "获取指定时段的信息")
//    @GetMapping("/getInfoOfRange")
//    public R getInfoOfRange(Long osId,String startTime, String endTime){
//        log.info("获取指定时段的信息接口被调用");
//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        LocalDateTime dateTime1 = LocalDateTime.parse(startTime, formatter);
//        LocalDateTime dateTime2 = LocalDateTime.parse(endTime, formatter);
//        InfoPolymerization res = iGetInfoService.getInfoBetween(osId,dateTime1,dateTime2);
////        List<InfoPolymerization> res = iGetInfoService.getInfoBetween(osId,dateTime1,dateTime2);
//        System.out.println("success");
//        return ResultUtil.data(res);
//    }
//
//
//    @ApiOperation(value = "查询主机列表")
//    @GetMapping("/osList")
//    public R osList(){
//        log.info("查询主机列表接口被调用");
//        List<OsInfoEntity> list = osinfoService.list();
//        List<OsInfoDtoVo> res = list.stream().map(
//                osInfoEntity -> {
//                    OsInfoDtoVo osInfoDtoVo = new OsInfoDtoVo();
//                    osInfoDtoVo.setId(osInfoEntity.getId().toString());
//                    osInfoDtoVo.setOs(osInfoEntity.getOs());
//                    osInfoDtoVo.setOsArch(osInfoEntity.getOsArch());
//                    osInfoDtoVo.setHostName(osInfoEntity.getHostName());
//                    return osInfoDtoVo;
//                }
//        ).collect(Collectors.toList());
//        log.info("查询主机列表成功");
//        return ResultUtil.data(res);
//    }
//
//}
